#! /usr/bin/env python
# Author: Diana Godfrey

PKG = 'languagememory'
import nounObj
from nounObj import Noun
import sys
from collections import defaultdict

objectWorld = []

def getPerson(name):
    for item in objectWorld:
        if item.getName() == name:
            return item

class PersonObject():
	
    staticID = 0
    favs = {}


    def __init__(self, newname):
        self.myname = newname
        self.id = PersonObject.staticID
        self.favs = {}
        PersonObject.staticID += 1
        objectWorld.append(self)

    def introduce(self):
        print "Hi, I'm a person object."
        guess = raw_input ("What do you think my name is?\n")
        print "No, it's %s." % self.myname

    def giveMajor(self, major):
        self.mymajor = major

    def giveAge(self, age):
        self.myage = age

    def giveFav(self, kind, thing):
        if kind in self.favs:
            self.favs[kind].append(Noun(thing))
        else:
            self.favs[kind] = [Noun(thing)]

    def getFav(self, kind):
        if kind in self.favs:
            for item in self.favs[kind]:
                return item.getName()
        else:
            return None

    def getAge(self):
        return self.myage

    def getID(self):
        return self.id

    def getName(self):
        return self.myname

    def getMajor(self):
        return self.mymajor

if __name__ == '__main__':
	obj = PersonObject("Caleb")
	obj.introduce()
